import React from 'react'
import ReactDOM from 'react-dom'
import './assets/styles/app.less'
import { Route, Router, Switch } from 'react-router'
import { createHashHistory } from 'history'
import routes from './route/index.js'
const history = createHashHistory()

ReactDOM.render(<Router history={history} >
  <Switch>
    {
      routes.map((route, index) => {
        return <Route path={route.path} key={index} render={props=>{
          return <route.component {...props} routes={route.routes}/>
        }}></Route>
      })
    }
  </Switch>
</Router>, document.getElementById('root'))

